import book.BookList;
import handleds.Administrator;
import handleds.Common;
import handleds.User;

import java.util.Scanner;


public class Main {
    public static Common login() {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入你的姓名:>");
        String name = scanner.nextLine();
        System.out.print("请输入你的身份[1.管理员 0.普通用户]:>");
        int identity = scanner.nextInt();
        if (identity == 1) {
            return new Administrator(name);
        }else {
            return new User(name);
        }
    }
    public static void main(String[] args) {
        BookList bookList = new BookList();
        Common ret = login();
        while(true) {
            int choice = ret.menu();
            ret.show(choice,bookList);
        }
    }
}
